from lxml import etree
from script.get_user_info.response.codeforces_response import cf_response
# 获取 codeforces用户的 rating
def cf_rating(name):
    response = cf_response(name)
    html = etree.HTML(response)
    rating_cp = html.xpath('//ul/li/span[@class and @style]/text()')
    return int(rating_cp[0])

if __name__ == '__main__':
    print(cf_rating("HoshinoChan"))
